package com.example.zyl.api.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.zyl.api.entity.OperateLog;
import com.example.zyl.api.entity.dto.OperateLogDto;
import com.example.zyl.api.service.IOperateLogService;
import com.example.zyl.common.query.annotation.ApiLog;
import com.example.zyl.common.query.enums.BusinessType;
import com.example.zyl.common.query.page.PageParam;
import com.example.zyl.common.query.page.PageResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 操作日志记录 前端控制器
 * </p>
 *
 * @author zyl
 * @since 2024-11-28
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/operateLog")
public class OperateLogController {

    private final IOperateLogService operateLogService;

    /**
     * 查询操作日志列表
     */
    @GetMapping("/searchList")
    @ApiLog(module = "查询操作日志列表", businessType = BusinessType.SELECT)
    public PageResult<List<OperateLog>> searchList(@RequestBody PageParam<OperateLog, OperateLogDto> pageParam) {
        Page<OperateLog> page = operateLogService.searchList(pageParam);
        return PageResult.pageResult(page);
    }


}
